import request from '../index';

const baseUrl = '/base-server';
const financeUrl = '/finance-server';

// 查询充电卡信息列表
export const URL_QUERYCHANNELLIST = `${baseUrl}/channel/queryChannelList`;
export const queryChannelList = (params: any, pages: any) => {
  return request({
    url: `${baseUrl}/channel/queryChannelList`,
    params: { form: params, pages: pages },
  });
};

// 冻结账号
export const frozenChannel = (params: any) => {
  return request({
    url: `${baseUrl}/channel/frozenChannel`,
    params: { form: params, successMsg: '2' },
  });
};

// 逻辑删除用户信息
export const deleteChannel = (params: any) => {
  return request({
    url: `${baseUrl}/channel/deleteChannel`,
    params: { form: params, successMsg: '2' },
  });
};

// 添加平台运营商
export const addChannel = (params: any) => {
  return request({
    url: `${baseUrl}/channel/addChannel`,
    params: { form: params, successMsg: '1' },
  });
};

// 修改平台运营商
export const updateChannel = (params: any) => {
  return request({
    url: `${baseUrl}/channel/updateChannel`,
    params: { form: params, successMsg: '1' },
  });
};

// 查询渠道信息详细
export const queryChannelDetail = (params: any) => {
  return request({
    url: `${baseUrl}/channel/queryChannelDetail`,
    params: { form: params },
  });
};

// 查询配置信息详细
export const queryChannelConfigDetail = (params: any) => {
  return request({
    url: `${baseUrl}/channel/queryChannelConfigDetail`,
    params: { form: params },
  });
};

// 查询配置信息详细
export const addConfig = (params: any) => {
  return request({
    url: `${baseUrl}/channel/addConfig`,
    params: { form: params },
  });
};


// 账户配置
export const getPaymentConfig = (params: any) => {
  return request({
    url: `${financeUrl}/account/getPaymentConfig`,
    params: { form: params },
  });
};

// 获取诺诺渠道配置
export const getNNConfigByChannelId = (params: any) => {
  return request({
    url: `${financeUrl}/ticket/getNNConfigByChannelId`,
    params: { form: params },
  });
};

// 变更诺诺渠道配置
export const changeNNConfig = (params: any) => {
  return request({
    url: `${financeUrl}/ticket/changeNNConfig`,
    params: { form: params, successMsg: '1' },
  });
};